package com.itheima.homework;

import java.util.Scanner;

public class Homework {
    public static void main(String[] args) {
        fifthHomework();
    }
    public static int firstHomework(int a, int b, int c){
        if (a > b){
            if(a > c){
                return a;
            }
            else {
                return c;
            }
        }
        else{
            if(b > c){
                return b;
            }
            else{
                return c;
            }
        }
    }

    public static int secondHomework(int year, int salary){
        if(year >= 10 && year < 15){
            salary += 20000;
        }
        else if(year >= 5){
            salary += 10000;
        }
        else if(year >= 3){
            salary += 5000;
        }
        else if(year >= 1){
            salary += 3000;
        }
        return salary;
    }

    public static void thirdHomework(){
        int sum = 0;
        for(int i = 0;i < 101;i++){
            if(i % 3 == 0 && i % 5 == 0){
                sum += i;
                System.out.printf("%d ", i);
            }
        }
        System.out.println("\n" + sum);
    }

    public static void fourthHomework(){
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int sum = 0;
        int count = 0;
        for (int i = 100;i < num;i++){
            if(i % 10 != 7 && (i / 10) % 10 != 5 && i % 100 != 3){
                System.out.println(i);
                count++;
                sum += i;
            }
        }
        System.out.println("sum: " + sum);
        System.out.println("count: " + count);
    }

    public static void fifthHomework(){
        int cout = 0;
        for (int i = 1000;i < 10000;i++){
            if((i % 10) + (i / 1000 % 10) == (i / 100 % 10) + (i / 10 % 10)){
                System.out.println(i);
                cout++;
            }
        }
        System.out.println("count: " + cout);
    }
}
